package com.hui.jwt.controller;

import lombok.Getter;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: SpringSecurity-jwt
 * @BelongsPackage: com.hui.jwt.controller
 * @Author: HUI
 * @CreateTime: 2022-04-02 20:01
 * @Description:
 */

@RestController
public class MyController {


    @RequestMapping("/test")
    public String test() {
        return "index at";
    }


    @GetMapping("/del")
    @Secured({"ROLE_admin"})
    public String testDel() {
        return "删除成功！";
    }


    @GetMapping("/add")
    @Secured({"ROLE_super"})
    public String testNotPermissions() {
        return "添加成功！";
    }
}
